import request from '@/utils/request'

/**
 * 获取配送员入驻状态
 * @param {string|number} deliveryUserId 配送员用户ID
 * @returns {Promise<Object>} 入驻状态数据
 */
export function getDeliveryEntryStatus(deliveryUserId) {
  return request({
    url: '/deliveryApply/status',
    method: 'GET',
    params: {
      deliveryUserId
    }
  })
}

/**
 * 提交配送员入驻申请
 * @param {Object} applyData 申请表单数据
 * @returns {Promise<Object>} 提交结果
 */
export function submitDeliveryEntry(applyData) {
  return request({
    url: '/deliveryApply/submit',
    method: 'POST',
    data: applyData
  })
}

/**
 * 获取最新配送员入驻申请详情
 * @param {string|number} deliveryUserId 配送员用户ID
 * @returns {Promise<Object>} 最新申请详情
 */
export function getLatestDeliveryEntry(deliveryUserId) {
  return request({
    url: '/deliveryApply/latest',
    method: 'GET',
    params: {
      deliveryUserId
    }
  })
}